{% extends layout ?: "@PayumCore/layout.html.twig" %}

{% block payum_body %}
    {{ parent() }}

    <form action="{{ actionUrl|default('') }}" method="POST">
        <script
            src="https://checkout.stripe.com/checkout.js" class="stripe-button"
            data-key="{{ publishable_key }}"
            data-image="{{ model.image|default("") }}"
            data-name="{{ model.name|default("") }}"
            data-description="{{ model.description|default("") }}"
            data-amount="{{ model.amount }}"
            data-currency="{{ model.currency|default("USD") }}"
            data-allowRememberMe="{{ model.local.allowRememberMe|default("false") }}"
            data-email="{{ model.local.email|default("") }}"
            data-locale="auto">
        </script>
    </form>
{% endblock %}

{% block payum_javascripts %}
    {{ parent() }}

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

    <script type="text/javascript">
        $(function() {$('form .stripe-button-el').click();});
    </script>

{% endblock %}
